<?php
namespace Api\Controller;
use Think\Controller;
class OauthController extends CommonController {
    
    public function index() {

            $token = I('post.token');
            
            $callback = I('post.callback');

            $str = urlencode($callback) . ',' .$token;
            
            $url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' . C('appid') . '&redirect_uri=http://dh.mybabygo.cn/backend/index.php/Wechat/Api/auth3/&token='.$token.'&response_type=code&scope=snsapi_userinfo&state=' . $str . '&connect_redirect=1#wechat_redirect';
            
            $data['url'] = $url;
            
            echo json_encode($data);
            
        }
    
}